<?php

namespace app\api\validate;

use think\Validate;

class Shop extends Validate
{
    protected $rule = [
        ['name', 'require|unique:shop_information', '店铺名称必填|店铺名称已存在'],
        ['order', 'require|unique:market_trading', '专利号必填|专利号已存在'],
        ['username', 'require', '商品名称必填'],
        ['p_id', 'between:1,10000000', '交易分类必填必填'],
        ['category_id', 'between:1,10000000', '行业分类必填'],
        ['c_id', 'between:1,10000000', '交易方式必填'],
        ['update', 'between:1,10000000', '发布期限必填'],
        ['store', 'require|number', '建议售价必填|价格必须是数字'],
        ['problem', 'require', '问题描述必填'],
    ];
    protected $scene = [
        'add' => ['name'], // 添加
        'publish' => ['order', 'username', 'p_id', 'category_id', 'c_id', 'update', 'store'],
        'problem' => ['problem'],
	];
}